home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v10n06.arc
/
STRU.PRG
< prev
next >
Wrap
Text File
|
1991-03-06
|
1KB
|
64 lines
* STRU.PRG list structure of database to screen or
* to a text file.
*
PARAMETERS param1, param2
CLEAR SCREEN
IF TYPE("param1") <> "C"
param1 = ""
? "SYNTAX: STRU <dbf filename> {output filename}"
QUIT
ENDIF
IF TYPE("param2") <> "C"
param2 = ""
ENDIF
IF "." $ param1
param1 = SUBSTR(param1,1,AT(".",param1)-1)
ENDIF
IF .NOT. FILE(param1+".dbf")
? "DATABASE FILE "+param1+" NOT FOUND"
QUIT
ENDIF
USE ¶m1
COPY TO temp STRUCTURE EXTENDED
USE temp
LIST field_name,field_type,field_len,field_dec TO FILE temp1234.xx1
? ""
? ""
IF LEN(param2) > 0
IF FILE(param2)
STORE SPACE(1) TO choice
loc = ROW()
@ loc,00 SAY param2 + ;
" Is About To Be OVERWRITTEN.... A)ppend.. R)ename.. F)ORGET..: "
@ loc,COL() GET choice PICTURE "!" VALID choice = "A" .OR. ;
choice = "R" .OR. choice = "F"
READ
IF choice = "A"
? ""
RUN COPY ¶m2+temp1234.xx1 ¶m2 >nul
ERASE temp1234.xx1
ENDIF
IF choice = "R"
STORE SPACE(12) TO fname
? ""
? ""
@ loc+2,00 SAY "ENTER A NEW VALID FILENAME..:" GET ;
fname PICTURE "!!!!!!!!!!!"
READ
RENAME temp1234.xx1 TO &fname
ENDIF
ELSE
RENAME temp1234.xx1 TO ¶m2
ENDIF
ELSE
RUN del temp1234.x* >nul
ENDIF
CLOSE ALL
ERASE temp.dbf
RETURN